#ifndef CLIENT_H
#define CLIENT_H

#include <QDialog>
#include <QtNetwork>

class QLabel;
class QLineEdit;
class QPushButton;


class Client : public QDialog
{
    Q_OBJECT

public:
    Client(QWidget *parent = 0);

private slots:
    void enableRegisterLoginButtons(const QString &);
    void doRegister();
    void doLogin();
    void connectToServer(QTcpSocket &, int);
    void sendRequest();
    void readResponse();

private:
    QLabel *usernameLabel;
    QLineEdit *usernameLineEdit;
    QPushButton *registerButton;
    QPushButton *loginButton;
    QPushButton *uploadButton;
    QLabel *statusLabel;
    QTcpSocket registrationTcpSocket;
    QTcpSocket loginTcpSocket;
    quint16 nextBlockSize;
    QString usernameString;
};

#endif
